package com.atguigu.gulimall.order;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 使用RabiitMq
 * 1.引入Amqp场景:   RabbitAutoConfiguration就会自动生效
 * <p>
 * 2.给容器中自动配置了
 * RabbitTemplate  AmqpAdmin   CachingConnectionFactory    RabbitMessagingTemplate
 * 所有的属性都是 spring.rabbitmq 进行绑定
 *
 * @ConfigurationProperties(prefix = "spring.rabbitmq")
 * public class RabbitProperties {}
 * 3.给配置文件中配置   spring.rabbitmq.xxx 信息
 * 4.@EnableRabbit  开启使用RabbitMQ
 * 5.@RabbitListener 监听消息,必须先开启RabbitMQ才能使用/在方法上使用
 *      @RabbitListener     类+方法(说明监听那些队列)
 *      @RabbitHandler      方法(重载区别不同的消息)
 */
@EnableRabbit
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallOrderApplication.class, args);
    }

}
